Skip to content

refactor(providers): online Bangumi authors from structured staffs + publisher split fix - #26

Merged
dyphire merged 2 commits into
masterfrom
feat/bangumi-staffs-persons
Oct 30, 2026
Merged

dyphire merged 2 commits into
masterfrom
feat/bangumi-staffs-persons

Conversation

@dyphire

@dyphire dyphire commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Follow-up to #25, two commits:

fix(providers): do not split publisher staff names on name separators (be8b213)

  • clean_author_names splits on separators including ・ (U+30FB); applying it to all staff positions broke publisher display-name mapping — e.g. スクウェア・エニックス (subject/60347) was split into two fragments with name_cn = None, so the exact-match against the infobox publisher value missed and the Chinese name 史克威尔·艾尼克斯 was lost.
  • Now only author-class positions (AUTHOR_POSITION_IDS = 2001/2002/2003/2007/2009/2010) are split; other positions (publishers etc.) only get annotation stripping.
  • Regression fixture added for person 497.

refactor(providers): make structured staffs the author source for online path (62dec76)

  • Verified the online /p1/subjects/{id}/staffs/persons endpoint and the offline archive dump are populated from the same wiki data: identical (person_id, position) sets across 8 sampled subjects (60347/268279/3510/64113/886/89713/1674/2735; differences only in post-snapshot freshness and dump-only fields pen_name/aliases).
  • The online mapper therefore uses the same persons-primary logic as the archive path: authors come from author-class staff positions with name_cn preferred, falling back to infobox parsing only when no author-class staff relation exists.
  • Removes the temporary infobox-primary online variant (to_*_persons_online, author_display_name, persons_name_mapping_only) introduced in feat(providers): use Bangumi structured staffs for authors and name_cn mapping #25 — online and offline now share one code path.
  • Publisher entities still come from infobox keys; staff persons remain name_cn mapping only (unchanged boundary).

Verification: 288 tests pass (updated online_persons_primary_authors covers persons-primary + infobox fallback), clippy shows only the 4 pre-existing warnings, rustfmt clean.

Staff ingest split every record's name on ・ et al., which broke
publishers whose names legitimately contain it (subject 60347:
スクウェア・エニックス was split into two fragments, name_cn dropped,
and publisher_display_name could no longer match the infobox value).
Only author-class positions (AUTHOR_POSITION_IDS) are split now;
other positions keep the full name with annotations stripped, and
name_cn is stripped instead of first-segment truncated so Chinese
names like 史克威尔·艾尼克斯 survive.
…ine path

The online staffs endpoint and the offline archive dump are populated from
the same wiki data (verified identical (person_id, position) sets across
samples), so the online mapper can use the same persons-primary logic as
the archive path: authors come from author-class staff positions with
name_cn preferred, falling back to infobox parsing only when no author-class
staff relation exists. Removes the temporary infobox-primary online variant
(to_*_persons_online, author_display_name, persons_name_mapping_only).
@dyphire
dyphire merged commit 4ab2d49 into master Oct 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant